<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <base href="${BaseContext}">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <link rel="stylesheet" href="static/css/base.css">
    <link rel="stylesheet" href="static/css/forget_password.css">
	<link rel="stylesheet" href="static/css/css.css">
   	
	<script src="static/js/jquery-3.2.1.min.js"></script>
    
</head>

<body>
    <main>
        <div class="container">
        
            <form class="ma" id="resetForm">
                <div class="form_header">
                    <div class="form_title">
                        <h2>重置密码</h2>
                    </div>                    
                	<input type="hidden" id="loginId" name="loginId" value="${loginId }">
                </div>
                <div class="form_body">
                    <input type="password" placeholder="请输入新密码" id="resetPwd" name="password">
                    <input type="password" style="width:100%" placeholder="再次输入新密码" id="restPwdAgain" name="pwdAgain">
                    <input type="button" id="submit-btn" style="margin:0px;width:100%" value="提交">
                </div>
            </form>
            
        </div>
    </main>
  
    <script type="text/javascript">
    	$(function(){
        	$('#submit-btn').on('click',function(){
            	var loginId = $('#loginId').val();
	    		var pwd = $('#resetPwd').val();
    			var pwd2 = $('#restPwdAgain').val();
	    		if(pwd!=pwd2){
					alert('两次密码要求输入一致，请重试！');
	        	}else{
					$.post('resetPwd.do',{password:pwd,loginId:loginId},function(data){
						if(confirm(data.msg)){
							window.location.href='logout.do';
						}
					},'json');
	            }
            });
    	});
    </script>
</body>

</html>